Skip to content

chore: pixel render tests, esbuild bump, ESLint + Prettier - #86

Merged
kiyeonjeon21 merged 5 commits into
mainfrom
chore/tooling-and-pixel-tests
Jun 22, 2026
Merged

chore: pixel render tests, esbuild bump, ESLint + Prettier#86
kiyeonjeon21 merged 5 commits into
mainfrom
chore/tooling-and-pixel-tests

Conversation

@kiyeonjeon21

@kiyeonjeon21 kiyeonjeon21 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Closes the three closeable gaps a project-evaluator pass flagged (it scored the repo 4.6/5). Items 4 and 5 (decompose the preview editor; document the loadSceneFromCode untrusted-code boundary) are noted for a later pass.

1. Pixel-level render correctness tests

Golden snapshots stop at the DisplayList and frame.test.ts only checks "valid PNG + differs over t", so a renderer-canvas bug (broken gradient mapping, black matte composite, the fill:"none"→black backdrop regression) shipped undetected.

New packages/render-cli/test/render-pixels.test.ts renders a real frame through Chromium, decodes it to raw rgb with ffmpeg, and asserts semantic pixel properties over each node's region (located via sceneGeometry):

  • liquid-glass — the backdrop panel is bright + varied (directly guards the black-panel bug; it would read luma ~17 vs the ~111 it now has).
  • gradient-demo — a linear-gradient fill varies across the shape.
  • group-fx-demo — a group composites offscreen (the mechanism mattes share).
  • alpha matte — a pure-shape matte cuts content to its mask.

Loose inequalities, so machine-independent and CI-runnable (unlike byte-exact pixel snapshots, which would have to be skipIf(IN_CI) like the DisplayList goldens).

2. esbuild bump

render-cli and reframe-video pin esbuild ^0.28.1, so the shipped/used esbuild is patched against the low-severity dev-server advisory GHSA-g7r4-m6w7-qqqr (esbuild's dev server is never used here). A workspace overrides to also force tsx/vitest's transitive esbuild was tried but reverted: only pnpm 10+ reads overrides from pnpm-workspace.yaml while CI runs pnpm 9, and pnpm 11 needs Node ≥22.13 (CI is Node 20). Not worth coupling the toolchain to a newer pnpm/Node for a dev-only advisory, so the single remaining low finding is tsx/vitest's transitive esbuild — dev tooling, never bundled.

3. ESLint + Prettier

  • ESLint (flat, syntactic: eslint:recommended + typescript-eslint recommended + eslint-config-prettier) wired into CI after typecheck. Fixed every finding it surfaced (unused imports, an empty interface, two test anys, an irregular whitespace, a caught-error cause, a statement-position ternary) and documented the CLI dispatcher's process.exit cases for no-fallthrough. No behavior changes.
  • Prettier is opt-in (.prettierrc + format / format:check scripts), not gated in CI: the codebase predates Prettier, so a --check gate would demand reformatting 110 files. Only this PR's new files are formatted.

Verification

  • pnpm test — 421 pass (417 + 4 new); DisplayList goldens byte-identical (no evaluate change).
  • pnpm typecheck, pnpm lint — clean.
  • pnpm audit — 1 low, dev-tooling only (tsx/vitest transitive esbuild); shipped deps patched.
  • pnpm --filter reframe-video build — succeeds on esbuild 0.28.1.

🤖 Generated with Claude Code

kiyeonjeon21 and others added 5 commits June 22, 2026 20:07
Golden snapshots stop at the DisplayList and frame.test.ts only checks
"valid PNG + differs over t", so a renderer-canvas bug (broken gradient
mapping, black matte composite, the fill:"none" to black backdrop
regression) ships undetected.

Render a real frame through Chromium, decode to raw rgb with ffmpeg, and
assert semantic pixel properties over each node's region (located via
sceneGeometry): the liquid-glass backdrop panel is bright and varied
(guards the black-panel bug), a gradient fill varies across the shape, a
group composites offscreen, and an alpha matte cuts content to its mask.
Loose inequalities, so machine-independent and CI-runnable (unlike
byte-exact pixel snapshots).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clears the low-severity dev-server advisory GHSA-g7r4-m6w7-qqqr (esbuild's
dev server / esbuild.serve is never used here). The direct deps in
render-cli and reframe-video move to ^0.28.1; a pnpm-workspace override
forces transitive esbuild (pulled in by tsx and vitest) past the patched
floor as well, so `pnpm audit` reports no vulnerabilities.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ESLint: eslint:recommended + typescript-eslint recommended (not type-aware,
strict tsc already covers types) + eslint-config-prettier, wired into CI
after typecheck. Fixes every finding it surfaced: unused imports across
example scenes and tests, an empty interface, two test `any`s, an irregular
whitespace, a caught-error without a cause, and a statement-position
ternary; the CLI dispatcher's process.exit cases are documented for
no-fallthrough. Node globals for .mjs/scripts; generated and build-copied
files are ignored.

Prettier is opt-in (.prettierrc + format / format:check scripts), not gated:
the codebase predates Prettier, so a --check gate would demand reformatting
110 files. Only this change's new files are formatted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The repo's pnpm-workspace.yaml already uses pnpm-10+ syntax (allowBuilds),
and the new esbuild `overrides` block lives there too — but pnpm 9 reads
overrides from package.json, so a pnpm-9 CI runner saw no overrides while
the lockfile recorded them (ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on a frozen
install). Align CI with the local pnpm (11.x); the lockfile is unchanged
9.0 format.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The pnpm-workspace `overrides` block forced audit to zero but only pnpm 10+
reads overrides from pnpm-workspace.yaml, while CI runs pnpm 9 — so a frozen
install hit ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. Bumping CI to pnpm 11 then
failed because pnpm 11 needs Node >= 22.13 (node:sqlite) and CI is on Node 20.

Rather than couple the toolchain to a newer pnpm/Node just for a dev-only
advisory, drop the override and revert CI to pnpm 9. The meaningful fix stays:
render-cli and reframe-video pin esbuild ^0.28.1, so the SHIPPED/used esbuild
is patched. The single remaining low advisory (GHSA-g7r4-m6w7-qqqr) is now only
tsx/vitest's transitive esbuild — dev tooling, never bundled, and esbuild's dev
server is never used here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kiyeonjeon21
kiyeonjeon21 merged commit 55600ad into main Jun 22, 2026
2 checks passed
@kiyeonjeon21
kiyeonjeon21 deleted the chore/tooling-and-pixel-tests branch June 22, 2026 11:24
kiyeonjeon21 added a commit that referenced this pull request Jun 22, 2026
Patch release: ships the esbuild ^0.28.1 bump. Dev-only test/lint tooling from #86 is not published.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant